<?php

try {
	if(file_exists("./router/router.php")){
		require_once './router/router.php';
	}
	else {
		throw new Exception("Nie znaleziono pliku!");
	}
}
catch(Exception $e){
	return $e->getMessage();
}
class ApplicationRouterControllerDataTest extends PHPUnit_Framework_TestCase {
	
	protected $router;
	protected $request_string;
	protected $post = array();
	protected function setUp(){
		$this->router = new Application_Router();
		$this->request_string = "?mytest&name=supertest";
		$this->post['name'] = "Adrian";
		$values = array();
		$values = $this->router->controller_loader($request_string, $post);
	}
	
	public function application_router_filepath_test(){
		$expected = "./functionalities/mytest/controllers/mytest.php";
		$this->assertEquals($expected, $values['files_value']['controller_path']);
	}
	
	public function application_router_class_name_test(){
		$expected = "Mytest_Controller_Mytest";
		$this->assertEquals($expected, $values['files_value']['controller_class']);
	}
	
	public function application_router_get_values_test(){
		$expected = "supertest";
		$this->assertEquals($expected, $values['get']['name']);
	}
	
	public function application_router_post_values_test(){
		$expected = "Adrian";
		$this->assertEquals($expected, $values['post']['name']);
	}
}